home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / 422mods.zip / RODMOD3C.422 < prev    next >
Text File  |  1993-03-16  |  5KB  |  144 lines

  1. RODMOD3C for v4.22
  2. Head-Banger #1 @9255
  3. Sat Mar 13 12:33:58 1993
  4. ┌────────────────────────────────────────────────────────────────────────────┐
  5. │ Mod Name: RodMod3c, Download Post       Mod Author: Green Bud @3481/@13481 │
  6. │ Difficulty: Very Easy                   Date: 9/15/92                      │
  7. │ WWIV Version: v4.21a & v4.22            Files Effected: msgbase1.c         │
  8. │ Description: Will extract a post to the temp directory, zip it up and let  │
  9. │ you download that file. v3c adds Title & Post to sysop log, Download Email.│
  10. └────────────────────────────────────────────────────────────────────────────┘
  11.   All I did was define where to add the new void and tell you to add the
  12. void to fcns.h or make fcns.h. Green Bud gets all the credit.
  13. This is great for letting your users download ANSI's, mods, or just good ol'
  14. regualar post.  I know there is another mod that does this, but I couldn't
  15. find it.  So I just wrote it myself.  Easy enough.
  16. If upgrading from RodMod3a or RodMod3b, just replace the old void dl_post with
  17. the new one and do steps 6 & 7.
  18.  
  19. 1Rod7Mod13c0, 2Download Post 0-2 Added title & sub to sysop log, Download email.0
  20.  
  21. STEP 1 - Don't blame me for anything that goes wrong...
  22. STEP 2 - Open msgbase1.c
  23. STEP 3 - Add the following void dl_post the top of msgbase1.c
  24.  
  25. void dl_post(char *rm, long rm1, char *rm2)  /* Void For RODMOD3c, D/L POST */
  26. {
  27.  char rm3[81],rm4[81],rm6=26,rm7;
  28.  int rm5;
  29.  
  30.  do {
  31.      rm4[0]=0;
  32.      prt(1,"\r\n Give This File A Name! 7[0No .EXT7]2:");0
  33.      mpl(8);
  34.      input(rm3,8);
  35.      for(rm5=0;rm5<8;rm5++)
  36.           if((rm3[rm5]==32)||(rm3[rm5]==46)||(rm3[rm5]==92))
  37.                rm3[rm5]=95;
  38.      if(rm3[0])
  39.          sprintf(rm4,"%s%s",syscfg.tempdir,rm3);
  40.      nl();
  41.   } while((!hangup) && (rm4[0]!=0) && (rm3[0]==0));
  42.   if((rm3[0]) && (!hangup)) {
  43.         rm5=open(rm4,O_RDWR | O_BINARY | O_CREAT , S_IREAD | S_IWRITE);
  44.         if(filelength(rm5)) {
  45.               lseek(rm5, -1L, SEEK_END);
  46.               read(rm5, ((void *)&rm7), 1);
  47.               if(rm7 == 26)
  48.                 lseek(rm5, -1L, SEEK_END);
  49.         }
  50.         write(rm5,rm2,strlen(rm2));
  51.         write(rm5,"\r\n",2);
  52.         write(rm5,(void *)rm,rm1);
  53.         write(rm5,&rm6,1);
  54.         close(rm5);
  55.         add_arc(rm3,rm3,1);
  56.         download_temp_arc(rm3,1);
  57.         sprintf(rm3,"5D/L Post:2 %s",rm2);0
  58.         sl1(0,rm3);
  59.         sprintf(rm3,"5From Sub:2 %s",subboards[usub[cursub].subnum].name);0
  60.         sl1(0,rm3);
  61.   }
  62.   farfree(rm);
  63. }
  64.  
  65.  
  66. STEP 4 - In void scan(int msgnum, int optype, int *nextsub) search for:
  67.  
  68.     } else
  69.       if (s[1]==0) {
  70.         switch(s[0]) {
  71.               case 'Q':
  72.  
  73.  
  74. STEP 5 - Add the following case statement after "switch(ch1) {" and
  75.          before "case 'Q':" so it looks like this:
  76.  
  77.     } else                                      /* EXISTING LINE */
  78.       if (s[1]==0) {                            /* EXISTING LINE */
  79.         switch(s[0]) {                          /* EXISTING LINE */
  80.  
  81. /* Case Statement For RodMod3, D/L POST  Start Adding */
  82.           case '@':
  83.             if((msgnum>0) && (msgnum<=nummsgs)) {
  84.             b=readfile(&(msgs[msgnum].msg),(subboards[curlsub].filename),&len);
  85.             dl_post(b,len,msgs[msgnum].title);  }
  86.             break;
  87.  /* Stop Adding */
  88.  
  89.               case 'Q':                         /* EXISTING LINE */
  90.  
  91.  
  92. STEP 6 - In void readmail(void) search for:
  93.  
  94.       else
  95.         if (so())
  96.             ch=onek("QSRIDAF?-+GEZPVUOLCN");
  97.         else
  98.           if (cs())
  99.             ch=onek("QSRIDAF?-+GZPVUOC");
  100.           else
  101.             ch=onek("QSRIDAF?-+G");
  102.       switch (ch) {
  103.     case 'E':
  104.           if ((so()) && (okmail)) {
  105.  
  106.  
  107. STEP 7 - Make the following changes to the onek()'s and add the following
  108.          case statement after "switch(ch) {" and before "case 'E':" so it
  109.          looks like this:
  110.  
  111.       else                                     /* EXISTING LINE */
  112.         if (so())                              /* EXISTING LINE */
  113. /*Add "@"*/ ch=onek("@QSRIDAF?-+GEZPVUOLCN");
  114.         else                                   /* EXISTING LINE */
  115.           if (cs())                            /* EXISTING LINE */
  116. /*Add "@"*/ ch=onek("@QSRIDAF?-+GZPVUOC");
  117.           else                                 /* EXISTING LINE */
  118. /*Add "@"*/ ch=onek("@QSRIDAF?-+G");
  119.       switch (ch) {                            /* EXISTING LINE */
  120.  /* Case For RodMod3, D/L POST  Start Adding */
  121.           case '@':
  122.           if (okmail) {
  123.             b=readfile(&(m.msg),"EMAIL",&len);
  124.             dl_post(b,len, m.title);  }
  125.             i2=0;
  126.             break;
  127. /* Stop Adding */
  128.     case 'E':                                  /* EXISTING LINE */
  129.           if ((so()) && (okmail)) {            /* EXISTING LINE */
  130.  
  131.  
  132. STEP 8 - Recompile!  Add @ to the appropriate menus in menus.msg/menusans.msg,
  133.          and inform your users of the option!
  134.  
  135. STEP 9 - Make FCNS.H or add:
  136.          void dl_post(char *rm, long rm1, char *rm2); /* add to top of File: ms
  137. gbase1.c
  138.  
  139. In case you haven't figured it out...
  140.         While your users are scanning the message bases or reading email,
  141.         they come across a nice little mod that they may like to install.
  142.         So they hit '@' and voila!  The puppy be downloaded.
  143.         Can also be used to download E-mail!!!
  144.